package com.zhss.dfs.server.model;

import java.util.Objects;

/**
 * @description: 数据写入磁盘记录
 * @Author liu Weidong
 * @Email:
 * @Date: 2024/5/6 15:41
 * @Version 1.0
 */
public class LogDiskRecorder {

    private Long endTxid;

    private String path;

    private Long beginTxid;

    public LogDiskRecorder(Long beginTxid, Long endTxid, String path) {
        this.beginTxid = beginTxid;
        this.endTxid = endTxid;
        this.path = path;
    }

    public Long getEndTxid() {
        return endTxid;
    }

    public void setEndTxid(Long endTxid) {
        this.endTxid = endTxid;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Long getBeginTxid() {
        return beginTxid;
    }

    public void setBeginTxid(Long beginTxid) {
        this.beginTxid = beginTxid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LogDiskRecorder that = (LogDiskRecorder) o;
        return endTxid.equals(that.endTxid) && path.equals(that.path) && beginTxid.equals(that.beginTxid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(endTxid, path, beginTxid);
    }
}
